package com.c78.fz.controller;

import com.c78.fz.common.result.Result;
import com.c78.fz.service.LoginService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class LoginController {
    @Resource
    LoginService loginService;

    @PostMapping("/login")
    public Result doLogin(String username,String password){
        return loginService.login(username,password);
    }

    @GetMapping("/logout")
    public Result logout(){
        return loginService.logout();
    }
}
